/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package simplemetrosystem.model.Command.EditCommand;

import simplemetrosystem.control.ElementManager;
import simplemetrosystem.model.Command.Command;
import simplemetrosystem.model.Element.MetroStation;

/**
 *
 * @author Eric Qian
 */
public class EditStationCommand implements Command {

    /**
     * 
     * @param station
     * @param name
     * @param cName
     * @param logX
     * @param logY
     * @param natX
     * @param natY
     */
    public EditStationCommand(MetroStation station, String name, String cName, int logX, int logY, double natX, double natY) {
        this.station = station;
        this.name = name;
        this.cName = cName;
        this.logX = logX;
        this.logY = logY;
        this.natX = natX;
        this.natY = natY;
        tempName = station.getName();
        tempCName = station.getChineseName();
        tempLogX = station.getLogX();
        tempLogY = station.getLogY();
        tempNatX = station.getNatY();
        tempNatY = station.getNatY();
    }

    public void execute() {
        ElementManager.getInstance().editStation(
                station, name, cName, logX, logY, natX, natY);
    }

    public void undo() {
        ElementManager.getInstance().editStation(
                station, tempName, tempCName, tempLogX, tempLogY, tempNatX, tempNatY);
    }
    private MetroStation station;
    private String name;
    private String cName;
    private int logX;
    private int logY;
    private double natX;
    private double natY;
    private String tempName;
    private String tempCName;
    private int tempLogX;
    private int tempLogY;
    private double tempNatX;
    private double tempNatY;
}
